define(function(require, exports){
	exports.onMain = function( boot, data, app ) {
		var con = app.getContainer({
			scenes: 'main',
			full: false,
			sitelist: false,
			setup_btn: false,
			title: LANG('分类数据表'),
			type: 'sidebar'
		});

		con.createBusiness(
			'category',
			'category/action/list.main',
			{},
			function(mod, notFirst){
				if (notFirst) {
					mod.reload();
				}
			}
		);
	};

	exports.onEdit = function( boot, data, app ) {
		var id = +data.param;
		var title = LANG('编辑分类信息');
		var con = app.getContainer({
			scenes: 'main',
			full: false,
			sitelist: false,
			setup_btn: false,
			title: title,
			type:'scroll'
		});

		con.createBusiness(data.name, 'category/action/edit.base', {
		}, function(mod) {
			if(mod && id){
				mod.reset().load(id);
			} else {
				mod.reset();
			}
		});

	};

	exports.onImport = function( boot, data, app ) {
		var id = +data.param;
		var title = LANG('导入分类信息');
		var con = app.getContainer({
			scenes: 'main',
			full: false,
			sitelist: false,
			setup_btn: false,
			title: title,
			type:'scroll'
		});

		con.createBusiness(data.name, 'category/action/import.base', {
		}, function(mod) {
			if(mod && id){
				mod.reset().load(id);
			} else {
				mod.reset();
			}
		});

	};

	exports.onBatchImport = function( boot, data, app ) {
		var id = +data.param;
		var title = LANG('批量导入分类信息');
		var con = app.getContainer({
			scenes: 'main',
			full: false,
			sitelist: false,
			setup_btn: false,
			title: title,
			type:'scroll'
		});

		con.createBusiness(data.name, 'category/action/import.batch', {
		}, function(mod) {
			mod.reset();
		});

	};

	exports.onBatchRemove = function( boot, data, app ) {
		var title = LANG('批量删除分类信息');
		var con = app.getContainer({
			scenes: 'main',
			full: false,
			sitelist: false,
			setup_btn: false,
			title: title,
			type:'scroll'
		});

		con.createBusiness(data.name, 'category/action/remove.batch', {
		}, function(mod) {
			mod.reset();
		});

	};

	exports.onGenerate = function( boot, data, app ) {
		var title = LANG('生成分类格式信息');
		var con = app.getContainer({
			scenes: 'main',
			full: false,
			sitelist: false,
			setup_btn: false,
			title: title,
			type:'scroll'
		});

		con.createBusiness(data.name, 'category/action/generate.base', {
		}, function(mod) {
			mod.reset();
		});

	};

});